<div id="main_content">
	<h1>Neues Todo</h1>
	<form action="todos.php" method="post" id="todo_form"  class="edit_form">
		<span class="desc">Felder mit (*) m&uuml;ssen ausgef&uuml;llt werden.</span>
		<input type="hidden" name="action" value="new" />
		<input type="hidden" name="p_id" value="{@pp:p_id}" />
		<pp:dynamic name="lID">
		<input type="hidden" name="lID" value="true" />
		</pp:dynamic>
		<p>
			<label class="label" for="title">Titel: *</label>
			<input type="text" id="title" name="title" value="" class="input"/>
		</p>
		<p>
			<label class="label" for="text">Text:</label>
			<textarea rows="10" cols="100" name="text" id="text" class="input"></textarea>
		</p>
		<p>
			<label class="label" for="tD">Zieldatum: *</label>
			<input type="text" id="tD" name="tD" value="" class="input"/>
		</p>
		<p>
			<span class="label">&nbsp;</span>
			<input type="submit" value="Erstellen"/>
			<input type="reset" value="Zur&uuml;cksetzten"/>
		</p>
	</form>
</div>
<script type="text/javascript">
	$(document).ready(function() {
		jQuery.validator.addMethod("myDate", function(value, element) { 
		    return Date.parseExact(value, "d.M.yyyy");
		});

		$("#todo_form").validate({
			rules: {
				title: "required",
				tD: {
					required: true,
					myDate: true
					}
			},
			messages: {
				title: "Bitte geben Sie einen Titel an.",
				tD: "Bitte geben Sie ein g&uuml;ltiges Datum an."
			}	
		});
	});
</script>